package edu.sctu.zhangwang.month201505.day20150517.TwoText;

/**
 * Created by user10 on 2015/5/17.
 */
public class TextMore {
    protected TeaCher[] teaChers;
    protected Student[] students;
    public TextMore(TeaCher[] teaChers){
        this.teaChers = teaChers;
    }
    public TextMore(Student[] studentL){
        this.students = studentL;
    }
    public void sotrNumber() {
        TeaCher[] teacherA = new TeaCher[teaChers.length];
        for (int i = 0; i <teaChers.length-1; i++) {
            for (int j=i;j<teaChers.length-1;j++) {
                if (teaChers[i].number < teaChers[j].number){
                    TeaCher temp = teaChers[i];
                    teaChers[i] = teaChers[j];
                    teaChers[j] = temp;
                }
            }
        }
    }
    public void sortStudent(Student[] student){
        Student[] teacher = new Student[student.length];
        for (int i=0;i<=student.length-1;i++){
            for (int j=i;j<=student.length-1;j++){
                if (student[i].score > student[j].score){
                    Student temp = student[i];
                    student[i] = student[j];
                    student[j] = temp;
                }
            }
        }

    }
    public TeaCher pritCoded() {
        TeaCher returnTeacher = null;
        for(TeaCher teaCher : this.teaChers){
            if (teaCher.teaTile.equals("教授")){
                returnTeacher = teaCher;
                System.out.println("\n为教授的老师有：\n老师姓名："+teaCher.name+"\t老师职称："+teaCher.teaTile);
            }
        }
       return returnTeacher;
    }
}
